struct ListNode* reverseList(struct ListNode* head){
    struct ListNode*cur=head;
    struct ListNode*newhead=NULL;
    while(cur)
    {
        struct ListNode* temp=cur->next;
        //头插
        cur->next = newhead;
        newhead = cur;
        //迭代
        cur = temp;
    }
    return newhead;
}